package com.ibox.utils;

import android.util.Log;

import java.nio.charset.Charset;

import okhttp3.logging.HttpLoggingInterceptor;

/**
 * Project IBox
 * Created by Amos
 * Created on 2017-10-12
 * Desc
 */

public class InterceptorUtils {
    public static String TAG = "----";
    private static String Token = "";
    public final static Charset UTF8 = Charset.forName("UTF-8");

    /**
     * 日志拦截器
     *
     * @return
     */
    public static HttpLoggingInterceptor LogInterceptor() {
        return new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
            @Override
            public void log(String message) {
                Log.w(TAG, "log: " + message);
            }
        }).setLevel(HttpLoggingInterceptor.Level.BODY);//设置打印数据的级别
    }
}
